/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package 编辑器.tabpane有关闭按钮;

import javax.swing.JTabbedPane;

/**
 *
 * @author yanxi
 */
public class TabPanel标题 extends javax.swing.JPanel { 
    private final JTabbedPane pane;

    public TabPanel标题(String s, JTabbedPane pane) {
        initComponents();
        jLabel_title.setText(s);
        this.pane = pane; 
        setOpaque(false); 
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel_title = new javax.swing.JLabel();
        jRadioButton关闭 = new javax.swing.JRadioButton();

        setLayout(new java.awt.BorderLayout());

        jLabel_title.setText("jLabel1");
        add(jLabel_title, java.awt.BorderLayout.LINE_START);

        jRadioButton关闭.setToolTipText("关闭");
        jRadioButton关闭.setOpaque(false);
        jRadioButton关闭.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton关闭ActionPerformed(evt);
            }
        });
        add(jRadioButton关闭, java.awt.BorderLayout.EAST);
    }// </editor-fold>//GEN-END:initComponents

    private void jRadioButton关闭ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton关闭ActionPerformed
        pane.remove(pane.indexOfTabComponent(this));
    }//GEN-LAST:event_jRadioButton关闭ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JLabel jLabel_title;
    public javax.swing.JRadioButton jRadioButton关闭;
    // End of variables declaration//GEN-END:variables
}
